<?php
/**
* PHP Template.
*/
?>
<script type="text/javascript">
function Validate() {
var scd_val = document.getElementById("iDMSCalendar_" + eventStart.getCalName() + "_date").value;
document.getElementById("sdate_val").value = scd_val;
var ecd_val = document.getElementById("iDMSCalendar_" + eventend.getCalName() + "_date").value;
document.getElementById("edate_val").value = ecd_val;
return true;
}
</script>
<div id="content">
    <div class="col1">
        <div class="col-padding">
            &nbsp;
        </div>
    </div>
    <div class="col2">
        <div class="col-padding">
            <?php if($this->phpsession->flashget("error")!=""): ?>
            <div class="error-box">
                <div class="container-padding">
                    <p>
                        <?= $this->phpsession->flashget("error") ?>
                    </p>
                </div>
            </div>
            <?php endif; ?>
            <h2 style="padding-bottom:15px;"><?= $subtitle ?></h2>
            <form name="" method="post" action="<?= $handleURL ?>" id="createEvent">
                <div class="input-div">
                    <label for="event_name"><span class="required">Title:</span></label>
                    <input type="text" name="event_name" <?php if(isset($runValidation)) { if($this->validation->name_error!="") {?>class="half-field form-error"<? }} else { echo "class=\"full-field\""; } ?> value="<?php if(isset($default_values["title"])) { echo $default_values["title"]; } ?>" id="event_name" maxlength="40" />
                </div>
                <div class="input-div"><label for="short_description"><span class="required">Short Description:</span></label>
                    <input type="text" maxlength="255" name="short_description" id="short_description" <?php if(isset($runValidation)) { if($this->validation->name_error!="") {?>class="half-field form-error"<? }} else { echo "class=\"full-field\""; } ?> value="<?php if(isset($default_values["short_description"])) { echo $default_values["short_description"]; } ?>" />
                </div>
                <div class="input-div"><label for="long_description"><span class="required">Long Description:</span></label>
                    <textarea name="long_description" id="long_description" cols="24" rows="5" class="full-field"><?php if(isset($default_values["long_description"])) { echo $default_values["long_description"]; } ?></textarea>
                </div>
                <div class="input-div" id="start_date_box"><label for="start_date"><span>Start Date:</span></label>
                    <script type="text/javascript">
                        var obj = document.getElementById("start_date_box");
                        var loc = findPos(obj);
                        var d = <?php echo (isset($default_values["startDate"]))?"'" . $default_values["startDate"]. "';":"getTodayDate();"; ?>
                        var eventStart = new iDMSCalendar(d,200,200,loc.y,loc.x); // construct with d(date), 200(width),200(height)
                        SetPreURL("/images/"); // sets the location of the idms/img folder, so if outside of idms base project, put "idms/"
                        eventStart.setName("eventStart"); // sets the name inside of the calendar object for internal Javascript calls
                        eventStart.MakeMonth(d,eventStart); // displays the calendar to the given date (usually same as constructed)
                    </script>
                    <input type="hidden" name="sdate_val" value="" id="sdate_val" />
                </div>
                <div class="input-div" id="end_date_box"><label for="end_date"><span>End Date:</span></label>
                    <script type="text/javascript">
                        var obj = document.getElementById("end_date_box");
                        var e = <?php echo (isset($default_values["endDate"]))?"'" . $default_values["endDate"]. "';":"getTodayDate();"; ?>
                        var eventend = new iDMSCalendar(e,200,200,loc.y,loc.x); // construct with d(date), 200(width),200(height)
                        SetPreURL("/images/"); // sets the location of the idms/img folder, so if outside of idms base project, put "idms/"
                        eventend.setName("eventend"); // sets the name inside of the calendar object for internal Javascript calls
                        eventend.MakeMonth(e,eventend); // displays the calendar to the given date (usually same as constructed)
                    </script>
                    <input type="hidden" name="edate_val" value="" id="edate_val" />
                </div>
                <div class="input-div"><label for="web_link"><span>URL Link:</span></label><input type="text" name="web_link" <?php if(isset($runValidation)) { if($this->validation->name_error!="") {?>class="form-error full-field"<? }} else { echo "class=\"full-field\""; } ?> value="<?php if(isset($default_values["web"])) { echo $default_values["web"]; } ?>" id="web_link" size="30" maxlength="120" /></div>
                <input type="submit" value="<?=$submitTxt?>" onclick="return Validate(event);"/>
                <?php if(isset($default_values["id"])): ?>
                    <input type="hidden" value="<?=$default_values["id"]?>" id="event_id" name="event_id"/>
                <?php endif; ?>
            </form>  
        </div>
    </div>
    <div class="col3">
        <div class="col-padding">
            HEY HEY HEY
        </div>
    </div>
</div>